package com.example.springbootdemo.controller.ExceptionDemo;

import com.example.springbootdemo.controller.ExceptionDemo.dto.ExceptionDemoDto;
import com.example.springbootdemo.controller.ExceptionDemo.vo.ExceptionDemoVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class ExceptionDemoController {


    @PostMapping("test/exception/controller")
    public ExceptionDemoVo testControllerException(@RequestBody ExceptionDemoDto dto){
        System.out.println("test -- exception");
        int i = 0 / dto.getNum();
        return new ExceptionDemoVo("suc");
    }

}
